home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / PartMaker 4.4 / PartMaker Documents / Script Runner• / Script Runner•.rsrc / dFRK_5051 < prev    next >
Encoding:
Text File  |  1995-12-12  |  6.0 KB  |  248 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: Orbit:SampleCode:ScriptRunner:Source:PaletteExt.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. #ifndef SOM_Module_Samples_defined
  11. #define SOM_Module_Samples_defined 1
  12. #include <som.xh>
  13.  
  14. /*
  15.  * Start of user-defined types:
  16.  */
  17. class SOMClass;
  18. class SOMObject;
  19. class ODFrame;
  20. class ODFacet;
  21. class ODObject;
  22. class ODExtension;
  23. class ODRefCntObject;
  24. class ODPart;
  25. class SampleCode_ScriptRunner;
  26. #define kPaletteExtension "Apple Computer:Extension:ScriptPalette"
  27.  
  28. /*
  29.  * End of user-defined types.
  30.  */
  31. #endif /* SOM_Module_Samples_defined */
  32.  
  33. #ifndef SOM_Samples_PaletteExt_xh
  34. #define SOM_Samples_PaletteExt_xh
  35.  
  36. class Samples_PaletteExt;
  37.  
  38. #define Samples_PaletteExt_MajorVersion 1
  39. #define Samples_PaletteExt_MinorVersion 0
  40.  
  41. /*
  42.  * Passthru lines: File: "C.xh", "before"
  43.  */
  44. class SampleCode_ScriptRunner;
  45.  
  46. /* C++ SOM defs */
  47. #include <somcls.xh>
  48. #include <somcm.xh>
  49.  
  50. /* C++ parent defs */
  51. #ifndef SOM_ODExtension_xh
  52. #include <Extensn.xh>
  53. #endif
  54.  
  55. #ifndef Samples_PaletteExt_API
  56. #define Samples_PaletteExt_API
  57. /*
  58.  * -- The Class API
  59.  */
  60.  
  61. /*
  62.  * Start of user-defined types:
  63.  */
  64.  
  65. /*
  66.  * End of user-defined types.
  67.  */
  68.  
  69. #ifdef OLDIBMSOMAPISUPPORT
  70. #define Samples_PaletteExtCClassData Samples_PaletteExtClassData
  71. #define Samples_PaletteExtNewClass(major,minor) somNewVersionedClassReference(Samples_PaletteExt,major,minor)
  72. #endif
  73.  
  74. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  75. #define Samples_PaletteExtMetaClass SOMClass
  76.  
  77.  
  78. /* The API to the Samples_PaletteExt class object, and the methods it introduces. */
  79. SOMEXTERN struct Samples_PaletteExtClassDataStructure {
  80. #ifdef OLDIBMSOMAPISUPPORT
  81.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  82. #else
  83.     long zero;
  84. #endif
  85.     somStaticClassInfo *sci;
  86.     somDToken        instanceDataToken;
  87.     long reserved [3];
  88.     somMToken Show;
  89.     somMToken Hide;
  90.     somMToken IsPaletteVisible;
  91.     somMToken Move;
  92.     somMToken GetLocation;
  93.     somMToken SetClient;
  94. } SOMDLINK Samples_PaletteExtClassData;
  95.  
  96. #if !defined(Samples_PaletteExt_Class_Source) && !defined(SOM_Module_paletteext_Source)
  97. #if PRAGMA_IMPORT_SUPPORTED
  98. #pragma import list Samples_PaletteExtClassData
  99. #endif
  100. #endif
  101.  
  102.  
  103. /*
  104.  * -- Typedefs and inline method declarations for left path inherited methods
  105.  * -- are omitted because this compilation had -museinheritedmethods in effect
  106.  */
  107.  
  108.  
  109. /*
  110.  * -- Typedefs for Samples_PaletteExt Method Procedures
  111.  */
  112. SOMEXTERN {
  113. typedef void   (* SOMLINK somTD_Samples_PaletteExt_Show)(Samples_PaletteExt *somSelf, Environment *ev);
  114. typedef void   (* SOMLINK somTD_Samples_PaletteExt_Hide)(Samples_PaletteExt *somSelf, Environment *ev);
  115. typedef ODBoolean   (* SOMLINK somTD_Samples_PaletteExt_IsPaletteVisible)(Samples_PaletteExt *somSelf, Environment *ev);
  116. typedef ODBoolean   (* SOMLINK somTD_Samples_PaletteExt_Move)(Samples_PaletteExt *somSelf, Environment *ev,
  117.         ODPoint* topleft);
  118. typedef ODPoint*   (* SOMLINK somTD_Samples_PaletteExt_GetLocation)(Samples_PaletteExt *somSelf, Environment *ev);
  119. typedef void   (* SOMLINK somTD_Samples_PaletteExt_SetClient)(Samples_PaletteExt *somSelf, Environment *ev,
  120.         ODPart* client);
  121. }
  122.  
  123. #endif /* Samples_PaletteExt_API */
  124.  
  125.  
  126. /*
  127.  * -- This emitter treats Method Tokens as Thunks by default.
  128.  * -- Use the sc modifier "nothunks" to change this default
  129.  */
  130. #undef somresolve_
  131. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  132.  
  133. /*
  134.  * -- The C++ Wrapper Class for Samples_PaletteExt
  135.  */
  136. class Samples_PaletteExt : public ODExtension
  137. {
  138. public:
  139.  
  140. // Samples_PaletteExt::new registers use of the class object, and then uses somNew
  141. // to allocate memory and load the object method table pointer. 
  142. void *operator new(size_t size)
  143. {
  144.     SOM_IgnoreWarning(size);
  145.     // Allocate memory using the default allocator for Samples_PaletteExt, and
  146.     // clear mem & set method table pointer, call basic initialization
  147. #ifdef SOMCHKNULL
  148.     void * __somResult = (void *)
  149.       somNewObject(Samples_PaletteExt);
  150.     SOMCHKNULL(__somResult);
  151.     return __somResult;
  152. #else
  153.     return (void*) somNewObject(Samples_PaletteExt);
  154. #endif
  155. }
  156.  
  157. // Samples_PaletteExt::delete uses the default deallocator for the object's class.
  158. void operator delete(void * obj)
  159. {
  160.     if (obj) {
  161.         SOM_Resolve(obj,SOMObject,somFree)
  162.            ( (SOMObject*) obj );
  163.     }
  164. }
  165.  
  166. /* method: Show */
  167. void   Show(Environment *ev)
  168. {
  169.    SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,Show)
  170.     (this,ev);
  171. #ifdef SOMCHKEXCEPT
  172.       SOMCHKEXCEPT;
  173. #endif
  174. }
  175.  
  176. /* method: Hide */
  177. void   Hide(Environment *ev)
  178. {
  179.    SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,Hide)
  180.     (this,ev);
  181. #ifdef SOMCHKEXCEPT
  182.       SOMCHKEXCEPT;
  183. #endif
  184. }
  185.  
  186. /* method: IsPaletteVisible */
  187. ODBoolean   IsPaletteVisible(Environment *ev)
  188. {
  189.    #ifdef SOMCHKEXCEPT
  190.    ODBoolean __somResult = 
  191.       SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,IsPaletteVisible)
  192.     (this,ev);
  193.       SOMCHKEXCEPT;
  194.    return __somResult;
  195. #else
  196.    return SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,IsPaletteVisible)
  197.     (this,ev);
  198. #endif
  199. }
  200.  
  201. /* method: Move */
  202. ODBoolean   Move(Environment *ev,
  203.         ODPoint* topleft)
  204. {
  205.    #ifdef SOMCHKEXCEPT
  206.    ODBoolean __somResult = 
  207.       SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,Move)
  208.     (this,ev,topleft);
  209.       SOMCHKEXCEPT;
  210.    return __somResult;
  211. #else
  212.    return SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,Move)
  213.     (this,ev,topleft);
  214. #endif
  215. }
  216.  
  217. /* method: GetLocation */
  218. ODPoint*   GetLocation(Environment *ev)
  219. {
  220.    #ifdef SOMCHKEXCEPT
  221.    ODPoint* __somResult = 
  222.       SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,GetLocation)
  223.     (this,ev);
  224.       SOMCHKEXCEPT;
  225.    return __somResult;
  226. #else
  227.    return SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,GetLocation)
  228.     (this,ev);
  229. #endif
  230. }
  231.  
  232. /* method: SetClient */
  233. void   SetClient(Environment *ev,
  234.         ODPart* client)
  235. {
  236.    SOM_ResolveD(this,Samples_PaletteExt,Samples_PaletteExt,SetClient)
  237.     (this,ev,client);
  238. #ifdef SOMCHKEXCEPT
  239.       SOMCHKEXCEPT;
  240. #endif
  241. }
  242.  
  243. };   /* Samples_PaletteExt */
  244.  
  245.  
  246.  
  247. #endif       /* SOM_Samples_PaletteExt_xh */
  248.